package com.qingneng.budget.web;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.opensymphony.xwork2.Action;
import com.qingneng.budget.service.sdk.IDemo;
import com.qingneng.budget.util.BaseAction;

public class DemoAction extends BaseAction {

	public IDemo demoService;

	// 构造函数
	public DemoAction(IDemo demoService) {
		this.demoService = demoService;
	}

	public DemoAction() {

	}

	// 返回集合
	//private List contractInfoList = null;
	
	private List rows = null;

	private Integer total;

	/*public List getContractInfoList() {
		return contractInfoList;
	}

	public void setContractInfoList(List contractInfoList) {
		this.contractInfoList = contractInfoList;
	}*/

	public List getRows() {
		return rows;
	}

	public void setRows(List rows) {
		this.rows = rows;
	}



	public Integer getTotal() {
		return total;
	}

	public void setTotal(Integer total) {
		this.total = total;
	}

	public String execute() {

		try {
		  Map	dataMap = demoService.loadJson();
		  rows = (List) dataMap.get("rows");
		  total = (Integer)dataMap.get("total");
		} catch (Exception e) {
			e.printStackTrace();
		}

		return Action.SUCCESS;
	}

}
